package com.pmcc.platform.salesman.repository;

import com.pmcc.platform.salesman.entity.Salesman;
import com.pmcc.platform.user.entity.UserInfo;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.domain.Specification;
import org.springframework.data.jpa.repository.JpaRepository;

import java.util.List;

public interface SalesmanRepository extends JpaRepository<Salesman, String> {



    Page<Salesman> findAll(Specification<Salesman> specification, Pageable pageable);

    List<Salesman> findAllByPhoneAndDelFlag(String phone, String delFlag);

    List<Salesman> findByPhoneAndDelFlag(String salesmanId, String s);

    Page<Salesman> findAllByDelFlag(String delFlag,Pageable pageable);

    Page<Salesman> findAllByDelFlagAndNameContainsAndPhoneContains(String delFlag,String name,String phone,Pageable pageable);

    List<Salesman> findAllByMinSalesmanUserIdAndDelFlag(String minSlaesmanUserId,String delFlag);
}
